﻿using ASP;
using HKB.Common;
using HKB.Web;
using HKB.Web.Shop;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using ucApi;

public partial class Passport_Logout : Shop, IRequiresSessionState
{
    protected DefaultProfile profile
    {
        get
        {
            return (DefaultProfile)this.Context.Profile;
        }
    }
    protected global_asax applicationInstance
    {
        get
        {
            return (global_asax)this.Context.ApplicationInstance;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string text = Fetch.GetOrPost("ComeUrl");
        if (text == string.Empty)
        {
            try
            {
                text = this.Page.Request.UrlReferrer.ToString();
            }
            catch
            {
            }
        }
        if (text == string.Empty)
        {
            text = this.config["SiteUrl"].ToString();
        }
        AppSetings appSetings = new AppSetings();
        if (appSetings.GetConfig("UC_ONorOFF") == "ON")
        {
            string s = Func.uc_user_synlogout();
            base.Response.Write(s);
        }
        base.user.Logout();
        if (this.config["HLIntegration"].ToString() == "1")
        {
            new Integrate(this.conn)
            {
                ComeUrl = text
            }.Send("Logout", "", "", "", "", "", 0, "", "");
        }
        else
        {
            this.WriteSuccessMsg("", Language.Get("PassPort/LogoutSuccess"), text);
        }
    }
}
